﻿using System;
using FluentAssertions;
using XValidation;
using XValidation.Attributes;
using XValidation.Exceptions;
using Xunit;

[assembly: Validation (AttributeTargetTypes = "XValidation.PostSharp.UnitTests.*")]

namespace XValidation.PostSharp.UnitTests
{
  public class Test
  {
    [Fact]
    public void name ()
    {
      var obj = new DomainClass();
      //obj.Invoking (x => x.Method1 (null))
      //    .ShouldThrow<NotNullValidationException>();
      obj.Invoking (x => x.Method1 (""))
          .ShouldThrow<EmailValidationException>();
    }

    public class DomainClass
    {
      public object Method1 ([NotNull] [IsEmail] string arg)
      {
        return null;
      }
    }
  }
}